package com.four.order.config;

/* *
 *类名：PaymentConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

import java.io.FileWriter;
import java.io.IOException;


public class PaymentConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118678502";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCHRSXbskcxr8fSH0RxqXIohTwJAmL0ePCyGR9RyfHzuBkbxj2wQx3DA9CZ9mm+cYjpGwJzfMRNsp9/RVykOk8J152iYOxXLkB/q0y4sV7ymw38OahQ0LEmnTBYPnk/MSp8/c84BNTAU5OjJt7ggCbtaSrbdgxZuzDaleOhpWLNR8NkCtODvBbX3Suvq20ZbNBezac4N0vJzsl72fJo4rAhoOq1uCDFklpRu06SfWxjYAxbJdkCnZYHwVaznRgoQs9pC0vD8CEiZ8qg/PkctcKGDrxR2GzXpMBYHL6IZY7eMPX0/T6HcKk3rsShX7seAKYHq3NbyM/4Rd7l5AJkjAInAgMBAAECggEAReeKJPsAp8C7du8Jo+N5R09zMwS0tro5SRCKiu3dx6F/+EZ+YrSMkNdL2gTpqK1rn2uB3MTBfZWtr0vdEFHBvshagiusd3FDi7aus1OWSbGvjIUPYpQ2uEnLTg8bAXkbB/TyPXThrXKDfXD9BO+1LkOHDlr3DvgZyxxiwoqBgKuwYA0LQe07mECRxmG0tQF2pK5IEelb954YZaRB9/WePNKCuR6kV4fcmihMu7TBnW2WF/5UIgy89akR1FSmQn3jzbzble74mauv4sFh5FmLGOemxa6OZtzAfQVlL/H+3iK9VWrWNFUGrwXsg65sTKyVW7/3ahRw+oPmmqU1cv7d4QKBgQDKTJp6znySyY5jDPAl9ZKK4EqvvhXROjheIGZtfh+mzYUvpVqXWQ7kP21dB8RVWSbsFH1OmtN6b+Gk869etO0IFYsR+lFcu+2kBRIN6DTaOiQhHeFANID8Dx66+r/09/vu4VY1pnpLzlMAHQr88v4y6wtev3Ip7TCGK7B05NTvpQKBgQCrLYeptyYyl2wganfUltmrXrpCyoPRsNxaVj7xhQYr/Vu94OqSelwQYDacR3BVo+I0OByz4pE+QTRybU7KHdRLfH6c/3MO9H0pnTVKw9JlHlTaxvVMlcCCki1QpHsCTMCQ+kD2zfNJ0aJuLwvJLi11b/kowxIVKjgEiKXHq2cA2wKBgQCKA370v4CfiCC7FK2VyBcE5gYuJamux2CDXuliU8R2QQpXOiE21gxhzZ/n8w+QBrWWJFhk0x3qDwBLT/DZ1OdNN51cU4FEmfWDi+4ITN4Z78aMTV1KN0e0LwCRIdbp4nEfRN5S1dPjecyIbEf90C16QX7NUiEp12becln9NczL/QKBgFdgdUhnacMXUiU105cbrV5xiyg+0Yy+96vRLG4CVgUsXaEN5w8AEHB3fEjHmorMjdHT9qrH8xXRGOFz9GztTwl9MfAX4PZ4TE9qpOJWFNZy5iOKvXnrUwoTbbglTXj+DqmyZGjW9eHvdTdDIoP940x37Lom4NsW4uNFkUHbt0dTAoGADzI1mncBaO0prFwrGGIMhYD5g5rMeh6Aq4T1g4OUlJwHb+SZrdI9GPIlBLAArQ/xy5KuTHQXbXp7jf9eCmzLCYXCcdAIh54zK1+CvueC0zidB/c/apn1Y5ELZnrZuHs+Bex50GZrbxVsMtepo9SN+r92RPklbvh3LXbJ2pL3MvY=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoZf8SbNmt6p6S1zCkhQAHRL96dzmsH6u5y89boQxEeKQqMDVysMatvLFbHMjGn7Oq1Bp6Xx3A6vkFz9hN6YTwFBnYg5l5/Rvh4/J+sbtVlqLWBk25cKHnOhzMsRv1zZSSO+0cdpjEpqVQa2nGVhvSjF6ZqQ9wWaZZCVsiEEhGJPdo2p2fg3F/nejcVDFigkVrxgLYylnvMvhJs2NrxqY27QgXASH5VLsJqesn+k4xG0D9JGJbx+O7UWqs85eMViflC8S2IXZgeUoDi8f3PfhY/+1ffsn+rrhvJT635uvW84TF0leV7qPLbAEGEq6TUnaY4MkotmgG71qx/Psi9we8QIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://hbudps.natappfree.cc/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://hbudps.natappfree.cc/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}

